<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script>
window.onload = function()
{
		var oBtn = document.getElementById('btn1');
		
		if(oBtn.attachEvent)
		{
				oBtn.attachEvent('onclick',function()
				{
					alert(9);	
				});

				oBtn.attachEvent('onclick',function(){
					alert(8);
				});
		}else
		{
				oBtn.addEventListener('click',function()
				{
					alert(9);	
				},false);

				oBtn.addEventListener('click',function()
				{
					alert(8);	
				},false);
		}
	/*
		//attachEvent(事件名，函数)   IE
		oBtn.attachEvent('onclick',function()
		{
			alert(9);	
		});
	
		oBtn.attachEvent('onclick',function(){
			alert(8);
		});

		
		//FF Chrome		addEventListener(事件名，函数，false)
	oBtn.addEventListener('click',function()
		{
			alert(9);	
		},false);
		
		oBtn.addEventListener('click',function()
		{
			alert(8);	
		},false);
			*/
	/*
		oBtn.onclick = function()
		{
				alert(9);
		};
	
		oBtn.onclick = function()
		{
				alert(8);
		};	*/
};

</script>
</head>

<body>
<input type="button" id="btn1">
</body>
</html>
